- behind_proxy = account_edit_link.present?

= form_for(displayed_user, url: user_path(displayed_user), method: :patch, remote: true) do |f|
  = f.hidden_field(:login, id: 'user')

  .mb-3.text-center= render(AvatarComponent.new(name: displayed_user.name, email: displayed_user.email, size: 200))
  .mb-3
    = f.text_field(:realname, readonly: behind_proxy, placeholder: 'Name', class: 'form-control')
  .mb-3
    = f.text_field(:login, readonly: true, class: 'form-control')
  .mb-3
    - role_titles.each do |title|
      %span.badge.text-bg-secondary
        = title.upcase
  .mb-3
    = f.text_area(:biography, rows: 6, placeholder: 'Biography', maxlength: User::MAX_BIOGRAPHY_LENGTH_ALLOWED, class: 'form-control')
    = f.label(:biography, class: 'd-block text-end') do
      %small.form-text#bio-chars-counter
  .mb-3
    = f.text_field(:email, required: true, email: true, placeholder: 'Email', readonly: behind_proxy, class: 'form-control')
  .mb-3
  - if behind_proxy
    %p
      You are behind a proxy. You can modify other data related to your profile by
      = link_to(' this link.', account_edit_link)
  .mb-3.text-end
    = button_tag 'Cancel', id: 'cancel-in-place-editing', class: 'cancel btn btn-outline-danger px-4'
    = submit_tag('Update', class: 'btn btn-primary px-4')
